# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.IdentityToolkit.V3.Model.IdentitytoolkitRelyingpartySetProjectConfigRequest do
  @moduledoc """
  Request to set the project configuration.

  ## Attributes

  *   `allowPasswordUser` (*type:* `boolean()`, *default:* `nil`) - Whether to allow password user sign in or sign up.
  *   `apiKey` (*type:* `String.t`, *default:* `nil`) - Browser API key, needed when making http request to Apiary.
  *   `authorizedDomains` (*type:* `list(String.t)`, *default:* `nil`) - Authorized domains for widget redirect.
  *   `changeEmailTemplate` (*type:* `GoogleApi.IdentityToolkit.V3.Model.EmailTemplate.t`, *default:* `nil`) - Change email template.
  *   `delegatedProjectNumber` (*type:* `String.t`, *default:* `nil`) - GCP project number of the requesting delegated app. Currently only intended for Firebase V1 migration.
  *   `enableAnonymousUser` (*type:* `boolean()`, *default:* `nil`) - Whether to enable anonymous user.
  *   `idpConfig` (*type:* `list(GoogleApi.IdentityToolkit.V3.Model.IdpConfig.t)`, *default:* `nil`) - Oauth2 provider configuration.
  *   `legacyResetPasswordTemplate` (*type:* `GoogleApi.IdentityToolkit.V3.Model.EmailTemplate.t`, *default:* `nil`) - Legacy reset password email template.
  *   `resetPasswordTemplate` (*type:* `GoogleApi.IdentityToolkit.V3.Model.EmailTemplate.t`, *default:* `nil`) - Reset password email template.
  *   `useEmailSending` (*type:* `boolean()`, *default:* `nil`) - Whether to use email sending provided by Firebear.
  *   `verifyEmailTemplate` (*type:* `GoogleApi.IdentityToolkit.V3.Model.EmailTemplate.t`, *default:* `nil`) - Verify email template.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allowPasswordUser => boolean() | nil,
          :apiKey => String.t() | nil,
          :authorizedDomains => list(String.t()) | nil,
          :changeEmailTemplate => GoogleApi.IdentityToolkit.V3.Model.EmailTemplate.t() | nil,
          :delegatedProjectNumber => String.t() | nil,
          :enableAnonymousUser => boolean() | nil,
          :idpConfig => list(GoogleApi.IdentityToolkit.V3.Model.IdpConfig.t()) | nil,
          :legacyResetPasswordTemplate =>
            GoogleApi.IdentityToolkit.V3.Model.EmailTemplate.t() | nil,
          :resetPasswordTemplate => GoogleApi.IdentityToolkit.V3.Model.EmailTemplate.t() | nil,
          :useEmailSending => boolean() | nil,
          :verifyEmailTemplate => GoogleApi.IdentityToolkit.V3.Model.EmailTemplate.t() | nil
        }

  field(:allowPasswordUser)
  field(:apiKey)
  field(:authorizedDomains, type: :list)
  field(:changeEmailTemplate, as: GoogleApi.IdentityToolkit.V3.Model.EmailTemplate)
  field(:delegatedProjectNumber)
  field(:enableAnonymousUser)
  field(:idpConfig, as: GoogleApi.IdentityToolkit.V3.Model.IdpConfig, type: :list)
  field(:legacyResetPasswordTemplate, as: GoogleApi.IdentityToolkit.V3.Model.EmailTemplate)
  field(:resetPasswordTemplate, as: GoogleApi.IdentityToolkit.V3.Model.EmailTemplate)
  field(:useEmailSending)
  field(:verifyEmailTemplate, as: GoogleApi.IdentityToolkit.V3.Model.EmailTemplate)
end

defimpl Poison.Decoder,
  for: GoogleApi.IdentityToolkit.V3.Model.IdentitytoolkitRelyingpartySetProjectConfigRequest do
  def decode(value, options) do
    GoogleApi.IdentityToolkit.V3.Model.IdentitytoolkitRelyingpartySetProjectConfigRequest.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.IdentityToolkit.V3.Model.IdentitytoolkitRelyingpartySetProjectConfigRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
